﻿using System;

namespace MoreExtentions
{
    public static partial class Linq
    {
        /// <summary>
        /// Ands the specified old predicate.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="oldPredicate">The old predicate.</param>
        /// <param name="newPredicate">The new predicate.</param>
        /// <returns></returns>
        public static Predicate<T> And<T>(this Predicate<T> oldPredicate, Predicate<T> newPredicate)
        {
            return t => oldPredicate(t) && newPredicate(t);
        }
    }
}